#ifndef _TASKQUEUE_H
#define _TASKQUEUE_H

#include "03_Mutex.hpp"
#include "04_ConditionVariable.hpp"
#include "05_Task.hpp"

#include <queue>
using std::queue;

#define Elemtype Task*
//class Task;

class TaskQueue
{
public:
    TaskQueue(int queue_max_size);
    ~TaskQueue() = default;
    bool empty();
    bool full();
    void push(Elemtype);
    Elemtype pop();
    void wakeup();

private:
    queue<Elemtype> _queue;
    int _queue_max_size;
    Mutex _mutex;
    ConditionVariable _notfull;
    ConditionVariable _notempty;
    bool _is_exit;

};

#endif

